<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRefundTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('refund', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->integer('user_id')->unsigned()->comment('申请人');

            $table->integer('admin_id')->nullable()->unsigned()->comment('操作人');

            $table->integer('order_goods_id')->unsigned()->comment('');

            $table->integer('status')->unsigned()->comment('状态，1是申请中，2是退款中，3是已退款，4是已驳回');

            $table->string('name')->comment('联系人');

            $table->string('phone')->comment('电话');

            $table->string('reason')->comment('退款原因');

            $table->integer('goods_id')->unsigned()->comment('商品表id');

            $table->integer('goods_sku_id')->unsigned()->comment('商品规格表');

            $table->string('goods_name')->comment('商品名称');

            $table->string('goods_sku_msg')->comment('商品规格信息');

            $table->string('goods_img')->comment('商品图片  ');



        });

        DB::statement("ALTER TABLE `refund` COMMENT='退款表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('refund');
    }
}
